/**
 * 
 */
$(function() {
	$('#welcome').css({
		'text-align' : 'center'
	});
	
	var html='';
	
	$.getJSON("/Server/loadSummary.php",{},function(data){
		html += '<div data-role="collapsible-set" id="collapsible-set-0">';
		var ind = 1;
		$.each(data,function display(key,value){
			html += '<div data-role="collapsible">';
			html += '<h4>'+key+'</h4><p>';
			
			if(($.isArray(value))){
				html += '<a href="/w/index.php/'+key.replace(/ $/,"").replace(/[ \/;,]([:] )*/g,"_")+'" data-ajax="false">Astrium wiki page - '+key+'</a>';
			}else if(value instanceof Object){
				html += '<div data-role="collapsible-set" id="collapsible-set-'+ind+'">';
				$.each(value, function(key1,value1){display(key1,value1);});
				html += '</div>';
			}
			html += '</p>';
			html += '</div>';
			ind++;
		});
		html += '</div>';
	});
	
	$('#questionMark').on('click', function(){
		$('#content').empty();
		$('#content').html(html).trigger("create");
	});
	
});